#ifndef __LGUIWINDOW_H__
#define __LGUIWINDOW_H__

#include "LAME.h"

class LGUIContainer;

class LGUIWindow : public LRect
{
public:
  friend class LGUIContainer;
    
protected:
  bool isDirty;
  int ID;
  int userData;
  void passOnFocus();
  
public:
  
  bool isVisible;
  LGUIContainer *parent;
  LGUIWindow(int _x, int _y, int _w, int _h);
  virtual ~LGUIWindow();
  
  virtual void draw(int xoff, int yoff);
  virtual void penDown(int px, int py) { }
  virtual void penMove(int px, int py, bool pressed) { }
  virtual void penUp(int px, int py) { }
  virtual void keyDown(int key) { }
  virtual void keyChar(int key) { }
  virtual void keyUp(int key) { }
  
  virtual void redraw() {
    isDirty = true;
  }
  virtual void show()
  {
    isVisible = true;
    redraw();
  }
  virtual void hide(bool refreshParent=true);
  virtual int getUserData() { return userData; }
  virtual int getID() { return ID; }
  virtual void setUserData(int u) { userData=u;}
  virtual void setValue(int _v) { }
  virtual int getValue() {return 0;}

  virtual bool isContainer()
  {
    return false;
  }
  LGUIWindow *next;
};


#endif //__LGUIWINDOW_H__